document.getElementById('showMeButton').addEventListener('click', () => {
    chrome.tabs.query({active: true, currentWindow: true}, (tabs) => {
        chrome.scripting.executeScript({
            target: {tabId: tabs[0].id},
            function: showSelectedText
        });
    });
});

document.getElementById('deepThinkButton').addEventListener('click', () => {
    chrome.tabs.query({active: true, currentWindow: true}, (tabs) => {
        chrome.scripting.executeScript({
            target: {tabId: tabs[0].id},
            function: deepThinkWithSelection
        });
    });
});

function showSelectedText() {
    const selected = window.getSelection().toString();
    console.log("Selected text:", selected);
    alert(selected);
}

function deepThinkWithSelection() {
    const selection = window.getSelection().toString();
    console.log("Sending to DeepSeek:", selection);
    alert("DeepSeek response: Placeholder Response");
}



